package com.sangmo.fts.teacher.model;

import com.sangmo.boot.framework.data.entity.general.AuditEntity;
import com.sangmo.boot.framework.data.json.meta.ExtView;
import com.sangmo.boot.framework.data.json.meta.Many;
import com.sangmo.boot.framework.plugin.dataview.def.meta.DataField;
import com.sangmo.boot.framework.plugin.dataview.def.meta.DataView;
import com.sangmo.fts.common.IConstants;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Entity
@Table(name = "score_setting")
@DataView
@ExtView
public class ScoreSetting extends AuditEntity {

    @Many(src = "id", value = "growthRatioSettings", target = GrowthRatioSetting.class, ref = "scoreSettingId")
    @Many(src = "id", value = "durationRatioSettings", target = DurationRatioSetting.class, ref = "scoreSettingId")

    @DataField(required = true, index = true)
    private Long userId;

    /** 业务流程评分占比 **/
    @DataField(value = IConstants.DATA_TYPE.INTEGER_POSITIVE, required = true)
    private int processRatio;

    /** 实训报告评分占比 **/
    @DataField(value = IConstants.DATA_TYPE.INTEGER_POSITIVE, required = true)
    private int reportRatio;

    /** 资产增长率评分占比 **/
    @DataField(value = IConstants.DATA_TYPE.INTEGER_POSITIVE, required = true)
    private int growthRatio;

    /** 实训时长评分占比 **/
    @DataField(value = IConstants.DATA_TYPE.INTEGER_POSITIVE, required = true)
    private int durationRatio;

    private String remark;

    @Transient
    private List<GrowthRatioSetting> growthRatioSettings;

    @Transient
    private List<DurationRatioSetting> durationRatioSettings;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public int getProcessRatio() {
        return processRatio;
    }

    public void setProcessRatio(int processRatio) {
        this.processRatio = processRatio;
    }

    public int getReportRatio() {
        return reportRatio;
    }

    public void setReportRatio(int reportRatio) {
        this.reportRatio = reportRatio;
    }

    public int getGrowthRatio() {
        return growthRatio;
    }

    public void setGrowthRatio(int growthRatio) {
        this.growthRatio = growthRatio;
    }

    public int getDurationRatio() {
        return durationRatio;
    }

    public void setDurationRatio(int durationRatio) {
        this.durationRatio = durationRatio;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<DurationRatioSetting> getDurationRatioSettings() {
        return durationRatioSettings;
    }

    public void setDurationRatioSettings(List<DurationRatioSetting> durationRatioSettings) {
        this.durationRatioSettings = durationRatioSettings;
    }

    public List<GrowthRatioSetting> getGrowthRatioSettings() {
        return growthRatioSettings;
    }

    public void setGrowthRatioSettings(List<GrowthRatioSetting> growthRatioSettings) {
        this.growthRatioSettings = growthRatioSettings;
    }
}
